const promise = new Promise((resolve, reject) => {
    reject("error")
    resolve("success2")
});

promise
    // 链式调用
    .then(res => {
        console.log("then1", res);
        let newP = new Promise((resolve, reject) => {
            setTimeout(() => {
                reject('newP error');            
            }, 1000)
        })
        return newP;
        // Promise.resolve()
        // return promise
    })
    .then(res => {
        console.log("then2", res);
    })
    // catch 当promise rejected后 执行catch
    // return promise return this
    .catch(err => {
        console.log("catch", err);
        // return 2
        // catch 会像then 一样 使用promise.return一样返回一个this
    })
    .then(res => {
        console.log("then3", res);
    })